﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RRHH.Entities;
using System.Data.SqlClient;
using System.Data;

namespace RRHH.DataAccess
{
    public class DAOEps
    {
        public List<BEEps> ListarEPS()
        {

            string sql = "SP_LISTAR_EPS";

            SqlCommand sqlCommand = new SqlCommand();
            sqlCommand.CommandText = sql;

            using (DataAccess adoDataService = new DataAccess())
            {
                List<BEEps> _BLEps = new List<BEEps>();
                IDataReader dr = adoDataService.ExecuteReader(sqlCommand);

                while (dr.Read())
                {
                    BEEps _BEEps = new BEEps();
                    _BEEps.idAuto = Convert.ToInt32(dr["IDAUTO"]);
                    _BEEps.descripcion = Convert.ToString(dr["DESCRIPCION"]);
                    _BEEps.estado = Convert.ToString(dr["ESTADO"]);
                    _BLEps.Add(_BEEps);
                }
                dr.Close();

                adoDataService.Dispose();

                return _BLEps;
            }

        }
    }
}
